package com.ruoyi.estate.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.estate.mapper.BuildingRoomMapper;
import com.ruoyi.estate.domain.BuildingRoom;
import com.ruoyi.estate.service.IBuildingRoomService;

/**
 * 房屋管理Service业务层处理
 * 
 * @author 博雅
 * @date 2023-12-19
 */
@Service
public class BuildingRoomServiceImpl implements IBuildingRoomService 
{
    @Autowired
    private BuildingRoomMapper buildingRoomMapper;

    /**
     * 查询房屋管理
     * 
     * @param roomId 房屋管理主键
     * @return 房屋管理
     */
    @Override
    public BuildingRoom selectBuildingRoomByRoomId(Long roomId)
    {
        return buildingRoomMapper.selectBuildingRoomByRoomId(roomId);
    }

    /**
     * 查询房屋管理列表
     * 
     * @param buildingRoom 房屋管理
     * @return 房屋管理
     */
    @Override
    public List<BuildingRoom> selectBuildingRoomList(BuildingRoom buildingRoom)
    {
        return buildingRoomMapper.selectBuildingRoomList(buildingRoom);
    }

    /**
     * 新增房屋管理
     * 
     * @param buildingRoom 房屋管理
     * @return 结果
     */
    @Override
    public int insertBuildingRoom(BuildingRoom buildingRoom)
    {
        buildingRoom.setCreateTime(DateUtils.getNowDate());
        return buildingRoomMapper.insertBuildingRoom(buildingRoom);
    }

    /**
     * 修改房屋管理
     * 
     * @param buildingRoom 房屋管理
     * @return 结果
     */
    @Override
    public int updateBuildingRoom(BuildingRoom buildingRoom)
    {
        return buildingRoomMapper.updateBuildingRoom(buildingRoom);
    }

    /**
     * 批量删除房屋管理
     * 
     * @param roomIds 需要删除的房屋管理主键
     * @return 结果
     */
    @Override
    public int deleteBuildingRoomByRoomIds(Long[] roomIds)
    {
        return buildingRoomMapper.deleteBuildingRoomByRoomIds(roomIds);
    }

    /**
     * 删除房屋管理信息
     * 
     * @param roomId 房屋管理主键
     * @return 结果
     */
    @Override
    public int deleteBuildingRoomByRoomId(Long roomId)
    {
        return buildingRoomMapper.deleteBuildingRoomByRoomId(roomId);
    }
}
